//
//  MotionAndLocationManager.h
//  记步-Demo
//
//  Created by qinlongqing on 14/11/10.
//  Copyright (c) 2014年 qinlongqing. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
#import <CoreMotion/CoreMotion.h>
#import "StepCountDBManager.h"


@class MotionAndLocationManager;
@protocol MotionAndLocationManagerDelegate <NSObject>

- (void)motionAndLocationManager:(MotionAndLocationManager *)motionAndLocationManager updataCurrentStepsDetailFrom_DB:(NSMutableArray *)stepsDetail;

- (void)motionAndLocationManagerUpdataCurrentStepsDetailFrom_M7:(MotionAndLocationManager *)motionAndLocationManager;

- (void)motionAndLocationManagerGetPedometerDataInAnHour:(CMPedometerData *)pedometerData;

- (void)didGetAllSteps:(NSUInteger)allSteps forDay:(NSString *)yyyyMMdd;

@end


@interface MotionAndLocationManager : NSObject

@property (nonatomic) BOOL isM7Support NS_AVAILABLE_IOS(7_0);

@property (nonatomic,assign) id<MotionAndLocationManagerDelegate>delegate;

+ (MotionAndLocationManager *)sharedInstance;

+ (void)deallocInstance;

- (BOOL)isLocationAvailable;

- (BOOL)isM7StepsDataAvailable;

- (void)start;

- (void)stop;

- (id)getStepFromDate:(NSDate *)fromDate toDate:(NSDate *)toDate;//使用前必须先设置isM7Support的值

- (NSUInteger)getAllStepsForDay:(NSString *)yyyyMMdd;//得到某一天内的所有步数


@end
